package model;/*
 *@创建者 lnn
 *@创建时间2016/8/300:19
 *@描述 ${TODO}
*/

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import org.json.JSONException;
import org.json.JSONObject;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

public class BoltCatIdModel {

    /**
     * result : 1
     * data : [{"imgUrl":"http://img.shandjj.com/uploads/20160826/57c0644423319.jpg","type":3,"title":"2件9.5折 3件8.5折 Adidas/三叶草鞋服运动专场","viewType":"1","flashDown":"2件9.5折 3件8.5折","salePoint":"2件9.5折 3件8.5折","saleTime":"剩4天","linkId":"4582"},{"imgUrl":"http://img.shandjj.com/uploads/20160825/57becbf9b96e6.jpg","type":3,"title":"PUMA彪马运动鞋专场","viewType":"1","flashDown":"闪降最高30元","salePoint":"","saleTime":"剩4天","linkId":"4483"},{"imgUrl":"http://img.shandjj.com/uploads/20160828/57c278d32ef7c.jpg","type":3,"title":"2件9折 3件8.5折 Nike&adidas开学特惠专场","viewType":"1","flashDown":"2件9折 3件8.5折","salePoint":"2件9折 3件8.5折","saleTime":"剩3天","linkId":"4568"},{"imgUrl":"http://img.shandjj.com/uploads/20160826/57c0490d76718.jpg","type":3,"title":"全场399元封顶 Adidas/NIKE清仓专场","viewType":"1","flashDown":"闪降最高20元","salePoint":"","saleTime":"剩3天","linkId":"4571"},{"imgUrl":"http://img.shandjj.com/uploads/20160824/57bd358d52f00.jpg","type":3,"title":"ASICS/亚瑟士运动鞋专场","viewType":"1","flashDown":"闪降最高50元","salePoint":"","saleTime":"剩10小时","linkId":"4416"},{"imgUrl":"http://img.shandjj.com/uploads/20160825/57be5d9caf737.jpg","type":3,"title":"Adidas阿迪达斯男女鞋服新品专场","viewType":"1","flashDown":"闪降最高30元","salePoint":"","saleTime":"剩10小时","linkId":"4497"},{"imgUrl":"http://img.shandjj.com/uploads/20160825/57beaf750bfe7.jpg","type":3,"title":"VANS潮流休闲鞋专场","viewType":"1","flashDown":"闪降最高30元","salePoint":"","saleTime":"剩2天","linkId":"4523"},{"imgUrl":"http://img.shandjj.com/uploads/20160826/57bff955a29b3.jpg","type":3,"title":"Nike男女鞋服新品专场","viewType":"1","flashDown":"闪降最高100元","salePoint":"","saleTime":"剩2天","linkId":"4534"},{"imgUrl":"http://img.shandjj.com/uploads/20160826/57c047ee8194c.jpg","type":3,"title":"杜戛地DZRZVD 运动户外专场","viewType":"1","flashDown":"闪降最高20元","salePoint":"","saleTime":"剩4天","linkId":"4566"},{"imgUrl":"http://img.shandjj.com/uploads/20160826/57bff7807c8fb.jpg","type":3,"title":"艾弗森 秋季运动鞋","viewType":"1","flashDown":"闪降最高20元","salePoint":"","saleTime":"剩3天","linkId":"4536"},{"imgUrl":"http://img.shandjj.com/uploads/20160824/57bd0ac89c7db.jpg","type":3,"title":"雷诺斯 时尚运动特惠专场","viewType":"1","flashDown":"闪降最高20元","salePoint":"","saleTime":"剩3天","linkId":"4437"},{"imgUrl":"http://img.shandjj.com/uploads/20160824/57bcff4f33de0.jpg","type":3,"title":"百事pepsi男女运动服饰专场","viewType":"1","flashDown":"闪降最高10元","salePoint":"","saleTime":"剩3天","linkId":"4472"},{"imgUrl":"http://img.shandjj.com/uploads/20160825/57bead96e3986.jpg","type":3,"title":"领舞者男女休闲运动专场","viewType":"1","flashDown":"闪降最高20元","salePoint":"","saleTime":"剩2天","linkId":"4509"},{"imgUrl":"http://img.shandjj.com/uploads/20160824/57bd07eb7779d.jpg","type":3,"title":"歆尼娅男女运动内衣大促专场","viewType":"1","flashDown":"闪降最高10元","salePoint":"","saleTime":"剩2天","linkId":"4453"},{"imgUrl":"http://img.shandjj.com/uploads/20160824/57bd100b4e756.jpg","type":3,"title":"哥斯兰顿 秋季上新专场","viewType":"1","flashDown":"闪降最高20元","salePoint":"","saleTime":"剩2天","linkId":"4419"},{"imgUrl":"http://img.shandjj.com/uploads/20160824/57bd58d468dee.jpg","type":3,"title":"CLUBNEWS夏季清仓品牌专场","viewType":"1","flashDown":"闪降最高20元","salePoint":"","saleTime":"剩10小时","linkId":"4476"}]
     * nowpage : 1
     * totals : 20
     * nextPage : 2
     * hot : null
     * brand : {"brandUrl":"http://hd.shandjj.com/index.php/PartitionsActivity/sportsgame"}
     * crazyBuy : null
     */

    private int result;
    private int nowpage;
    private String totals;
    private int nextPage;
    private Object hot;
    /**
     * brandUrl : http://hd.shandjj.com/index.php/PartitionsActivity/sportsgame
     */

    private BrandBean brand;
    private Object crazyBuy;
    /**
     * imgUrl : http://img.shandjj.com/uploads/20160826/57c0644423319.jpg
     * type : 3
     * title : 2件9.5折 3件8.5折 Adidas/三叶草鞋服运动专场
     * viewType : 1
     * flashDown : 2件9.5折 3件8.5折
     * salePoint : 2件9.5折 3件8.5折
     * saleTime : 剩4天
     * linkId : 4582
     */

    private List<DataBean> data;

    public static BoltCatIdModel objectFromData(String str) {

        return new Gson().fromJson(str, BoltCatIdModel.class);
    }

    public static BoltCatIdModel objectFromData(String str, String key) {

        try {
            JSONObject jsonObject = new JSONObject(str);

            return new Gson().fromJson(jsonObject.getString(str), BoltCatIdModel.class);
        } catch (JSONException e) {
            e.printStackTrace();
        }

        return null;
    }

    public static List<BoltCatIdModel> arrayBoltCatIdModelFromData(String str) {

        Type listType = new TypeToken<ArrayList<BoltCatIdModel>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public static List<BoltCatIdModel> arrayBoltCatIdModelFromData(String str, String key) {

        try {
            JSONObject jsonObject = new JSONObject(str);
            Type listType = new TypeToken<ArrayList<BoltCatIdModel>>() {
            }.getType();

            return new Gson().fromJson(jsonObject.getString(str), listType);

        } catch (JSONException e) {
            e.printStackTrace();
        }

        return new ArrayList();


    }

    public int getResult() {
        return result;
    }

    public void setResult(int result) {
        this.result = result;
    }

    public int getNowpage() {
        return nowpage;
    }

    public void setNowpage(int nowpage) {
        this.nowpage = nowpage;
    }

    public String getTotals() {
        return totals;
    }

    public void setTotals(String totals) {
        this.totals = totals;
    }

    public int getNextPage() {
        return nextPage;
    }

    public void setNextPage(int nextPage) {
        this.nextPage = nextPage;
    }

    public Object getHot() {
        return hot;
    }

    public void setHot(Object hot) {
        this.hot = hot;
    }

    public BrandBean getBrand() {
        return brand;
    }

    public void setBrand(BrandBean brand) {
        this.brand = brand;
    }

    public Object getCrazyBuy() {
        return crazyBuy;
    }

    public void setCrazyBuy(Object crazyBuy) {
        this.crazyBuy = crazyBuy;
    }

    public List<DataBean> getData() {
        return data;
    }

    public void setData(List<DataBean> data) {
        this.data = data;
    }

    public static class BrandBean {
        private String brandUrl;

        public static BrandBean objectFromData(String str) {

            return new Gson().fromJson(str, BrandBean.class);
        }

        public static BrandBean objectFromData(String str, String key) {

            try {
                JSONObject jsonObject = new JSONObject(str);

                return new Gson().fromJson(jsonObject.getString(str), BrandBean.class);
            } catch (JSONException e) {
                e.printStackTrace();
            }

            return null;
        }

        public static List<BrandBean> arrayBrandBeanFromData(String str) {

            Type listType = new TypeToken<ArrayList<BrandBean>>() {
            }.getType();

            return new Gson().fromJson(str, listType);
        }

        public static List<BrandBean> arrayBrandBeanFromData(String str, String key) {

            try {
                JSONObject jsonObject = new JSONObject(str);
                Type listType = new TypeToken<ArrayList<BrandBean>>() {
                }.getType();

                return new Gson().fromJson(jsonObject.getString(str), listType);

            } catch (JSONException e) {
                e.printStackTrace();
            }

            return new ArrayList();


        }

        public String getBrandUrl() {
            return brandUrl;
        }

        public void setBrandUrl(String brandUrl) {
            this.brandUrl = brandUrl;
        }
    }

    public static class DataBean {
        private String imgUrl;
        private int type;
        private String title;
        private String viewType;
        private String flashDown;
        private String salePoint;
        private String saleTime;
        private String linkId;

        public static DataBean objectFromData(String str) {

            return new Gson().fromJson(str, DataBean.class);
        }

        public static DataBean objectFromData(String str, String key) {

            try {
                JSONObject jsonObject = new JSONObject(str);

                return new Gson().fromJson(jsonObject.getString(str), DataBean.class);
            } catch (JSONException e) {
                e.printStackTrace();
            }

            return null;
        }

        public static List<DataBean> arrayDataBeanFromData(String str) {

            Type listType = new TypeToken<ArrayList<DataBean>>() {
            }.getType();

            return new Gson().fromJson(str, listType);
        }

        public static List<DataBean> arrayDataBeanFromData(String str, String key) {

            try {
                JSONObject jsonObject = new JSONObject(str);
                Type listType = new TypeToken<ArrayList<DataBean>>() {
                }.getType();

                return new Gson().fromJson(jsonObject.getString(str), listType);

            } catch (JSONException e) {
                e.printStackTrace();
            }

            return new ArrayList();


        }

        public String getImgUrl() {
            return imgUrl;
        }

        public void setImgUrl(String imgUrl) {
            this.imgUrl = imgUrl;
        }

        public int getType() {
            return type;
        }

        public void setType(int type) {
            this.type = type;
        }

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public String getViewType() {
            return viewType;
        }

        public void setViewType(String viewType) {
            this.viewType = viewType;
        }

        public String getFlashDown() {
            return flashDown;
        }

        public void setFlashDown(String flashDown) {
            this.flashDown = flashDown;
        }

        public String getSalePoint() {
            return salePoint;
        }

        public void setSalePoint(String salePoint) {
            this.salePoint = salePoint;
        }

        public String getSaleTime() {
            return saleTime;
        }

        public void setSaleTime(String saleTime) {
            this.saleTime = saleTime;
        }

        public String getLinkId() {
            return linkId;
        }

        public void setLinkId(String linkId) {
            this.linkId = linkId;
        }
    }
}
